using System;
using System.IO;

namespace RayDen.Library.Data.Import.Loader3DS {
    internal enum Groups {
        C_PRIMARY = 0x4D4D,
        C_OBJECTINFO = 0x3D3D,
        C_VERSION = 0x0002,
        C_EDITKEYFRAME = 0xB000,
        C_MATERIAL = 0xAFFF,
        C_MATNAME = 0xA000,
        C_MATAMBIENT = 0xA010,
        C_MATDIFFUSE = 0xA020,
        C_MATSPECULAR = 0xA030,
        C_MATSHININESS = 0xA040,
        C_MATMAP = 0xA200,
        C_MATMAPFILE = 0xA300,
        C_OBJECT = 0x4000,
        C_OBJECT_MESH = 0x4100,
        C_OBJECT_VERTICES = 0x4110,
        C_OBJECT_FACES = 0x4120,
        C_OBJECT_MATERIAL = 0x4130,
        C_OBJECT_UV = 0x4140
    }

    internal class ThreeDSChunk {
        public ushort ID;
        public uint Length;
        public int BytesRead;

        public ThreeDSChunk(BinaryReader reader) {
            // 2 byte ID
            ID = reader.ReadUInt16();
            //Console.WriteLine ("ID: {0}", ID.ToString("x"));

            // 4 byte length
            Length = reader.ReadUInt32();
            //Console.WriteLine ("Length: {0}", Length);

            // = 6
            BytesRead = 6;
        }
    }
}